﻿using System;
using MyFloridaHouse.libSvUtilities.Commands;

namespace MyFloridaHouse.libSvOpenDistricts.ViewModel
{
    public partial class ViewModelBase
    {
        private bool _isDialogOpen = false;
        public bool isDialogOpen 
        { 
            get { return _isDialogOpen; }
            set
            {
                if (value != _isDialogOpen)
                {
                    _isDialogOpen = value;
                    NotifyPropertyChanged("isDialogOpen");
                    // every time a ViewModelBase property is changed, all commands will execute RaiseCanExecuteChanged
                }
            }
        }

        public void ReserveDialog(DelegateCommand cmd)
        {
            isDialogOpen = true;
        }

        public void ReleaseDialog(DelegateCommand cmd)
        {
            isDialogOpen = false;
        }

    }
}
